<template>
  <div class="header-info">
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">头部设置</el-divider>
      </div>
      <el-form-item label="区域高度">
        <el-input-number
          :min="0"
          size="small"
          v-model="optionsInfo.headHeight"
        />
      </el-form-item>
      <el-form-item label="背景颜色">
        <el-color-picker
          size="small"
          show-alpha
          :predefine="predefineColors"
          v-model="optionsInfo.backgroundColor"
        />
      </el-form-item>
    </div>
    <!--科室设置-->
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">科室设置</el-divider>
      </div>
      <el-form-item label="科室隐藏">
        <el-switch v-model="optionsInfo.deptHide" />
        <template v-if="true">
          <el-tooltip
            class="item"
            effect="dark"
            content="Bottom Center 提示文字"
            placement="bottom"
          >
            <div slot="content">
              如果科室被隐藏将会显示当前医生就诊的患者科室;<br />
              如果当前患者不存在则取当前医生关联的上一个就诊患者科室
            </div>
            <el-button class="tooltip-icon"
              ><i class="el-icon-warning"
            /></el-button>
          </el-tooltip>
        </template>
      </el-form-item>

      <el-form-item label="诊室隐藏">
        <el-switch v-model="optionsInfo.roomHide" :disabled="true" />
      </el-form-item>
      <!--诊室选中字段-->
      <template v-if="!optionsInfo['roomHide']">
        <roomNameKeyEditor
          :designer="designer"
          :selected-widget="selectedWidget"
          :option-model="optionModel"
        />
      </template>
    </div>
    <template v-if="optionsInfo['layerNameKey'] === 'room-call-patient'">
      <div
        class="list-item-setting"
        v-for="(item, index, key) in optionsInfo['layerInfo']"
        :key="index"
      >
        <div class="title-info">
          <el-divider content-position="left">{{
            index === "current" ? "就诊弹层设置" : "候诊弹层设置"
          }}</el-divider>
        </div>
        <el-form-item label="背景颜色">
          <el-color-picker
            size="small"
            show-alpha
            :predefine="predefineColors"
            v-model="optionsInfo['layerInfo'][index].backgroundColor"
          />
        </el-form-item>
        <el-form-item label="标题字体色">
          <el-color-picker
            size="small"
            show-alpha
            :predefine="predefineColors"
            v-model="optionsInfo['layerInfo'][index].color"
          />
        </el-form-item>
        <el-form-item label="内容字体色">
          <el-color-picker
            size="small"
            show-alpha
            :predefine="predefineColors"
            v-model="optionsInfo['layerInfo'][index].patientColor"
          />
        </el-form-item>
      </div>
    </template>
  </div>
</template>

<script>
import constantDic from "@/utils/vue-i18n/lang/zh-CN";
import roomNameKeyEditor from "@sc/templateDetails/modules/homeRight/property-editor/module/scene-edit/basicInfo/roomNameKey-editor.vue";
import * as types from "@c/public/form-designer/devType/datas-types";

export default {
  name: "DRCDoublePatientInfoConfig-editor",
  components: { roomNameKeyEditor },
  componentName: "DRCDoublePatientInfoConfig-editor",
  mixins: [],

  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },

  inject: ["serverFieldList", "getDesignerConfig"],

  data() {
    return {
      radio: 1,
      options: [
        {
          value: 1,
          label: "叫1等1",
        },
        {
          value: 2,
          label: "叫1等2",
        },
      ],
      optionsInfo: Object(),
      constantDic: constantDic,
      predefineColors: types["predefineColors"],
    };
  },

  watch: {
    // 组件的所有信息
    optionModel: {
      handler: function (val) {
        this.optionsInfo = val[val.config];
      },
      deep: true,
      immediate: true,
    },
  },
};
</script>


<style lang="scss" scoped>
.wait-patient-set {
  display: flex;
  flex-direction: column;
  ::v-deep .el-form-item__label {
    width: 100% !important;
  }
  ::v-deep .el-form-item__content {
    margin-left: 0 !important;
    .el-radio-group {
      display: flex;
      flex-direction: column;
      .el-radio {
        padding: 10px 0;
      }
    }
  }
}

.tooltip-icon {
  border: none;
  background: transparent;
  padding: 0 12px 0 12px;
  font-size: 18px;
  border-radius: 0;
  color: #e6a23c;
}
</style>